package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusTeamMapper;
import com.ruoyi.business.domain.BusTeam;
import com.ruoyi.business.service.IBusTeamService;
import javax.annotation.Resource;

/**
 * 班组管理Service业务层处理
 * 
 * @author wf
 * @date 2024-07-10
 */
@Service
public class BusTeamServiceImpl implements IBusTeamService 
{
    @Resource
    private BusTeamMapper busTeamMapper;

    /**
     * 查询班组管理
     * 
     * @param id 班组管理主键
     * @return 班组管理
     */
    @Override
    public BusTeam selectBusTeamById(Long id)
    {
        return busTeamMapper.selectBusTeamById(id);
    }

    /**
     * 查询班组管理列表
     * 
     * @param busTeam 班组管理
     * @return 班组管理
     */
    @Override
    public List<BusTeam> selectBusTeamList(BusTeam busTeam)
    {
        return busTeamMapper.selectBusTeamList(busTeam);
    }

    /**
     * 新增班组管理
     * 
     * @param busTeam 班组管理
     * @return 结果
     */
    @Override
    public int insertBusTeam(BusTeam busTeam)
    {
        busTeam.setCreateUser(SecurityUtils.getUserId());
        busTeam.setCreateBy(SecurityUtils.getUsername());
        busTeam.setCreateTime(DateUtils.getNowDate());
        busTeam.setUpdateUser(SecurityUtils.getUserId());
        busTeam.setUpdateBy(SecurityUtils.getUsername());
        busTeam.setUpdateTime(DateUtils.getNowDate());
        return busTeamMapper.insertBusTeam(busTeam);
    }

    /**
     * 修改班组管理
     * 
     * @param busTeam 班组管理
     * @return 结果
     */
    @Override
    public int updateBusTeam(BusTeam busTeam)
    {
        busTeam.setUpdateUser(SecurityUtils.getUserId());
        busTeam.setUpdateBy(SecurityUtils.getUsername());
        busTeam.setUpdateTime(DateUtils.getNowDate());
        return busTeamMapper.updateBusTeam(busTeam);
    }

    /**
     * 批量删除班组管理
     * 
     * @param ids 需要删除的班组管理主键
     * @return 结果
     */
    @Override
    public int deleteBusTeamByIds(Long[] ids)
    {
        return busTeamMapper.deleteBusTeamByIds(ids);
    }

    /**
     * 删除班组管理信息
     * 
     * @param id 班组管理主键
     * @return 结果
     */
    @Override
    public int deleteBusTeamById(Long id)
    {
        return busTeamMapper.deleteBusTeamById(id);
    }

    @Override
    public List<BusTeam> selectBusGroupTeamList() {
        return busTeamMapper.selectBusGroupTeamList();
    }
}
